<?php

class Application_Form_Message extends Zend_Form
{

    public function init()
    {
    	$fromAlias = new Zend_Form_Element_Hidden('fromAlias');
    	$toAlias = new Zend_Form_Element_Text('toAlias');
        $toAlias->setLabel('Player alias:')
           ->setRequired(true);
           
        $title = new Zend_Form_Element_Text('title');
        $title->setLabel('Title:');
        
        $message = new Zend_Form_Element_Textarea('message');
        $message->setAttrib('cols', '70')
   				->setAttrib('rows', '10');
   		
        $send = new Zend_Form_Element_Submit('send');
        $send->setLabel('SEND');
        
        $this->addElements(array(
                        $fromAlias,
                        $toAlias,
                        $title,
                        $message,
                        $send
                        ));          

        $this->setElementDecorators(array(
									'ViewHelper',
								     array( array('data' => 'HtmlTag'), 
									   	    array('tag' => 'span', 'id' => 'messageElement')
										   ),
									 array('Label', 
									 		array('tag' => 'span', 'id' => 'messageLabel')
									 	   )
									 //,array(array('row' => 'HtmlTag'), array('tag' => 'p')) // this is to group 		togheter the 2 elements
									));
										  
		$send->setDecorators(array('ViewHelper',
									    array( array('data' => 'HtmlTag'), 
									   	    array('tag' => 'span', 'id' => 'sendMessage')
										   )
									));                
        
        
		$this->setDecorators(array(
						'FormElements',
						array('HtmlTag', array('tag' => 'div', 'class'=> 'messageForm')),
						'Form'
						));
    }


}

